﻿@model Record

@{
    ViewBag.Title = "Мини дота гайд (запись)";
}


<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
<script src="@Url.ContentWithVersion("~/Scripts/record.js")" type="text/javascript"></script>

<h2>Мини дота гайд запись</h2>

<style>
    #map
    {
        overflow:hidden;
    }
    
    .selected 
    {
        border: solid 1px blue
    }
</style>

@if (Model != null)
{
    @Html.Hidden("load", Model.Data);
}

@using (Html.BeginForm())
{
    @Html.Hidden("Data")

    if (Model == null)
    {
        <div>
            <b>Автор:</b> @Html.TextBox("Author", (object)ViewBag.Author) 
            <b>Пароль (нужен для получения призов): </b> @Html.Password("Password")

             <input type="submit" value="Сохранить" id="save" />
        </div>
        <h5>Стратегия:</h5>
        @Html.TextArea("Comment", new { cols = 80, rows = 5, style = "margin:30px" })    
    }
    else
    {
        <div>@Html.ShowUserName(Model.Author) @Html.CreateUserButton(Model.Author, Model.Password) 
        @Html.Action("Rating", "Home", new { id = Model.Id, controller = "Records", current = Model.Raiting })</div>
        <div>@Html.ReplaceKeyOnContent(Model.Comment, true)</div>
    }
    
    <div id="map" onselectstart='return false;'
     style="position:relative; -moz-user-select: none;-webkit-user-select: none;width:600px;height:600px;background-image:url(@(Url.Content("~/Content/BigMap.jpg")))">
    </div>

    <div id="controlbutton" style="margin:30px">
        <input type="button" id="toBegin" value="<<" />
        <input type="button" id="prev" value="<" />
        <span id="currentStep"></span>
        <input type="button" id="next" value=">" />
        <input type="button" id="toFinish" value=">>" />
        <input type="button" id="play" value="play" />
        <input type="button" id="stop" value="stop" />
    </div>
    
    if (Model == null)
    {
    <div id="heroButton" style="margin:30px">
        <input type="button" id="add" value="Добавить героя" />
        
        <input type="button" id="attack" value="Атаковать" />
        <input type="button" id="noattack" value="Не атаковать" />
        <span id="message"></span>
    </div>
    <input type="button" id="clear" value="Очистить" />
    }
}

@if (Model == null)
{
    <div id="dialog" style="display:none">
        @Html.HeroByGroup((Hero[])ViewBag.Heroes,
            h => Html.Image(h.AvatarImageId, "Heroes", h.Id, new
            {
                style = "width:51px;height:51px; margin:2px; cursor:pointer",
                heroId = h.Id,
                @class = "Hero"
            }
        ))
    </div>
}

@if (Model != null)
{
    @Html.Comments("Запись", Url.RouteUrl("Record", new { id = Model.Id }));
}